package com.ulook.lookplanet.data.repository;

import com.ulook.lookplanet.data.source.CommunityDataSource;
import com.ulook.lookplanet.util.net.ResponseCallback;

/**
 * 描述：
 *
 * @author L1998
 * @data 2021/4/20
 */
public class CommunityRepository {

    private static CommunityRepository instance;
    private CommunityDataSource dataSource;

    private CommunityRepository(CommunityDataSource dataSource){
        this.dataSource = dataSource;
    }

    public static CommunityRepository getInstance(){
        if(instance == null){
            instance = new CommunityRepository(new CommunityDataSource());
        }
        return instance;
    }

    /**
     * 获取小组列表
     */
    public void getCommunityData(ResponseCallback callback){
        dataSource.getCommunityData(callback);
    }

    /**
     * 查询话题列表
     */
    public void getTopicsForComuId(String comuId, ResponseCallback callback){
        dataSource.getTopicsForComuId(comuId, callback);
    }
}
